<?php
namespace humhub\modules\api;

return [
    'id' => 'api',
    'class' => 'humhub\modules\api\Module',
    'namespace' => 'humhub\modules\api',
    'controllerNamespace' => 'humhub\modules\api',
    'urlManagerRules' => [
        ['class' => 'humhub\modules\space\components\UrlRule'],
        // profile
      	'GET api/profile' => 'api/profile',
      	'GET api/profile/<id:\d+>' => 'api/profile/view',
        // user
      	'GET api/user/<id:\d+>' => 'api/user/view',
      	'POST api/user' => 'api/user/edit',
      	//'GET api/user/search/<search:.+>' => 'api/user/search',
        // follow
      	'POST api/follow/follow/<id:\d+>' => 'api/follow/follow',
      	'POST api/follow/unfollow/<id:\d+>' => 'api/follow/unfollow',
        // post
        'POST api/post' => 'api/post/create',
        'POST api/post/post' => 'api/post/post',
        'GET api/post/<id:\d+>' => 'api/post/view',
        // login
        //[GET] post / space / dashboard
        'POST api/postcc' => 'api/postcc/create',
        'PUT,PATCH api/postcc' => 'api/postcc/edit',
        'POST api/postcc/delete' => 'api/postcc/delete',
        'POST api/content/delete' => 'api/content/delete',
        //comment
        'GET api/comment' => 'api/comment/show',
        'POST api/comment' => 'api/comment/create',
        'PUT,PATCH api/comment' => 'api/comment/edit',
        'POST api/comment/delete' => 'api/comment/delete',
        //task
        'POST api/task'            => 'api/task/create',
        'PUT,PATCH api/task'       => 'api/task/edit',
        'PUT,PATCH api/task/team' => 'api/task/team',
      	'GET api/task'          => 'api/task/info',
      	'GET api/task/<id:\d+>' => 'api/task/view',
      	'GET api/task/users'    => 'api/task/users',
      	'GET api/task/users/<id:\d+>' => 'api/task/users',
        //task job
        'POST api/taskjob'            => 'api/taskjob/create',
        'GET api/taskjob' => 'api/taskjob/show',
        //Course
      	'GET api/course'          => 'api/course/info',
      	'GET api/course/list'     => 'api/course/list',
        //Space
      	'GET api/space/<id:\d+>' => 'api/space/view',
    ],
    'events' => [
      [
          'class' => \humhub\modules\admin\widgets\AdminMenu::className(),
          'event' => \humhub\modules\admin\widgets\AdminMenu::EVENT_INIT,
          'callback' => [
              'humhub\modules\api\Events',
              'onAdminMenuInit'
          ]
      ]
    ],
];
?>
